#!/usr/bin/env python
# coding:utf-8
from sina_finance import SinaFinance
from database import StockDatabase


def get_list():
    stock_db = StockDatabase("stock")
    sina_finance = SinaFinance()
    qbgg_list = sina_finance.qbgg_hk()
    for item in qbgg_list:
        print(f"processing {item.get("name", "")}")
        stock_db.add_stock(
            reg=item.get("reg", ""),
            name=item.get("name", ""),
            symbol=item.get("symbol", ""),
            engname=item.get("engname", ""))


if __name__ == "__main__":
    get_list()
